using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class SO_ADMEXDCOVERMap : EntityTypeConfiguration<SO_ADMEXDCOVER>
    {
        public SO_ADMEXDCOVERMap()
        {
            // Primary Key
            this.HasKey(t => new { t.ENTRY_DATE, t.Current_Admission });

            // Properties
            this.Property(t => t.ID)
                .HasMaxLength(10);

            this.Property(t => t.PATIENT_ID)
                .HasMaxLength(6);

            this.Property(t => t.CASE__)
                .HasMaxLength(15);

            this.Property(t => t.Latin_Name)
                .HasMaxLength(60);

            this.Property(t => t.Arabic_Name)
                .HasMaxLength(30);

            this.Property(t => t.Phones)
                .HasMaxLength(30);

            this.Property(t => t.ADDRESS)
                .HasMaxLength(80);

            this.Property(t => t.Current_Admission)
                .IsRequired()
                .HasMaxLength(4);

            // Table & Column Mappings
            this.ToTable("SO_ADMEXDCOVER");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.PATIENT_ID).HasColumnName("PATIENT_ID");
            this.Property(t => t.CASE__).HasColumnName("CASE_#");
            this.Property(t => t.Latin_Name).HasColumnName("Latin_Name");
            this.Property(t => t.Arabic_Name).HasColumnName("Arabic_Name");
            this.Property(t => t.Phones).HasColumnName("Phones");
            this.Property(t => t.ADDRESS).HasColumnName("ADDRESS");
            this.Property(t => t.ENTRY_DATE).HasColumnName("ENTRY_DATE");
            this.Property(t => t.DISCHARGE_DATE).HasColumnName("DISCHARGE_DATE");
            this.Property(t => t.REQUIRED_DISCHARGE_DATE_FOR_GUARANTOR1).HasColumnName("REQUIRED_DISCHARGE_DATE_FOR_GUARANTOR1");
            this.Property(t => t.REQUIRED_DISCHARGE_DATE_FOR_GUARANTOR2).HasColumnName("REQUIRED_DISCHARGE_DATE_FOR_GUARANTOR2");
            this.Property(t => t.REMAINIG_DATE_FOR_GUARANTOR1).HasColumnName("REMAINIG_DATE_FOR_GUARANTOR1");
            this.Property(t => t.REMAINIG_DATE_FOR_GUARANTOR2).HasColumnName("REMAINIG_DATE_FOR_GUARANTOR2");
            this.Property(t => t.DAYSCEILING_FOR_GUARANTOR1).HasColumnName("DAYSCEILING_FOR_GUARANTOR1");
            this.Property(t => t.DAYSCEILING_FOR_GUARANTOR2).HasColumnName("DAYSCEILING_FOR_GUARANTOR2");
            this.Property(t => t.Current_Admission).HasColumnName("Current_Admission");
        }
    }
}
